﻿using System;
using System.Collections.Generic;
using System.Text;
using WebLibraryMaker.Properties;
using System.IO;

namespace WebLibraryMaker
{
    public class Pathes
    {
        public string TemporaryDirectory 
        { 
            get
            {
                return Settings.Default.TemporaryPath;
            } 
        }

        public string DotNetDirectory { get; set; }
        public string ProjectDirectory { get; set; }
        public string ProjectName { get; set; }
        public string IntermediateFolderName { get; set; }
        public string OutputFolderName { get; set; }
        public string KeyFileName { get; set; }


        #region Output 
        public string OutputDirectory
        {
            get
            {
                return Path.Combine(ProjectDirectory, OutputFolderName);
            }
        }
        
        public string OutputFileBillet
        {
            get
            {
                return Path.Combine(OutputDirectory, ProjectName);
            }
        }

        public string OutputDll
        {
            get
            {
                return OutputFileBillet + ".dll"; 
            }
        }
        #endregion

        public string KeyFileBillet
        {
            get
            {
                return (KeyFileName == null) || (KeyFileName.Trim() == "") ? null : Path.Combine(ProjectDirectory, KeyFileName);
            }
        }

        #region Intermediate
        public string IntermediateDirectory
        {
            get
            {
                return Path.Combine(ProjectDirectory, IntermediateFolderName);
            }
        }

        public string IntermediateFileBillet
        {
            get
            {
                return Path.Combine(IntermediateDirectory, ProjectName);
            }
        }

        public string IntermediateDll
        {
            get
            {
                return IntermediateFileBillet + ".dll";
            }
        }
        #endregion

       #region Compiled
        public string CompiledFileBillet
        {
            get
            {
                return Path.Combine(Path.Combine(TemporaryDirectory, "bin"), ProjectName);
            }
        }
        
        public string CompiledFile
        {
            get
            {
                return CompiledFileBillet + ".dll";
            }
        }

        public string CompiledDirectory
        {
            get
            {
                return Path.Combine(TemporaryDirectory, "bin");
            }
        }     
       #endregion        
    }
}
